import network from '@system.network';
export default {
    data: {
        title: 'World'
    },
    unsubscribe(){
        network.unsubscribe();
    },
    subscribe(){
        network.subscribe({
            success: function(data) {
                console.log('network type change type:' + data.type);
            },
            fail: function(data, code) {
                console.log('fail to subscribe network, code:' + code + ', data:' + data);
            },
        });
    },
    onDestroy(){
        this.unsubscribe()
    },
    getType(){
        network.getType({
            success: function(data) {
                console.log('success get network type:' + data.type);
            },
            fail: function(data, code) {
                console.log('fail to get network type code:' + code + ', data:' + data);
            },
        });
    },
}
